<body>
    This frame should handle the click event on the anchor element in the other window.
    <script>
        function closeWin(winToClose) {
            winToClose.close();
            setTimeout(doneHandler, 1);

            function doneHandler() {
                if (!winToClose.closed)
                    setTimeout(doneHandler, 1);
                else if (window.testRunner)
                  testRunner.notifyDone();
            }
        }

        function handleClick(event) {
            var newWin = window.open('resources/window-opened.html', 'badName', 'width=100, height=100');
            if (newWin) {
                parent.log("Window was opened! Test succeeded!");
                closeWin(newWin);
            }

            event.preventDefault();
            return false;
        }
    </script>
</body>
